<template>
  <chart
    :chart-option="data"
    class="chart-line"
  ></chart>
</template>

<script>
import chart from './index.vue'
export default {
  data () {
    return {
      data: {}
    }
  },
  components: { chart },
  created () {
    this.getData()
  },
  methods: {
    getData () {
      this.data = {
        xAxis: {
          type: 'category',
          data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
        },
        yAxis: {
          type: 'value'
        },
        series: [
          {
            data: [150, 230, 224, 218, 135, 147, 260],
            type: 'line'
          }
        ]
      }
    }
  }
}
</script>

<style lang='scss' scoped>
.chart-line {
  width: 500px;
  height: 500px;
}
</style>